Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Conversation

@ttys3
Copy link

@ttys3 ttys3 commented Feb 20, 2021

fix(websearch): searchterm should be trimmed to avoid extra space before the actual term words

the builtin Search engine does not have this problem.

when you add custom engine, the problem comes.

for example add an engine named "foo", the trigger is foo , and the url is: https://example.com/q=%s

when you just type like the builtin Google, let's say we typed gg hello, the correct URL generated:

it is https://www.google.com/search?q=hello

but for the custom engine, we typed foo hello, the result is: https://example.com/q= hello

be aware that the space before hello

and if you need to avoid the problem, you need to type foohello.

this is not as the same rule as the builtin ones (like Google)

maybe there's better solution ?

why only the builtin engine does not have the problem?

@githorse
Copy link

See related Albert issue.

I was surprised to find out that the trigger does not require a whitespace to work. Took me a minute to figure out why searching Albert for "Software Manager" only showed "Stack Overflow" instead; I expected that I would need to type so<space> to search Stack Overflow, not just any string starting with so. That's the behavior on Alfred, Chrome, Firefox, DuckDuckGo, and pretty much everywhere else.

Actually I really like how, say, Firefox and Chrome work here, where I type the trigger (gi for google images), press space, and then a little tag ([Google Images]) shows up at the left of the search bar to show me what "search engine" I'm using.

Websearch is violating the principle of least surprise here out of the box. I agree the flexibility of using a custom delimiter (e.g. :) is nice. Could the delimiter be a configurable option, defaulting to whitespace? (Including possibly "no delimiter", the current setting, though I'm not totally convinced that's useful.)

@ttys3
Copy link
Author

ttys3 commented Apr 17, 2021

The space should not be a part of the keymap, if this is by design, this is anti-human.

It took me a few days to finally find out that the pre-installed websearch config has a space after the term gg or so ...

I think this is the problem.

Of course, it is your code, your repo, and you have the decision to not change the design.

albertlauncher works perfect, if it does not have the whitespace special design.

@githorse thank you sharing your idea, but I think I'd better close this PR.

according to albertlauncher/albert#321

I've switched to Ulauncher, it does almost the same thing.

And the most important thing, it is user friendly. It does not have anti-human config design.

@ttys3 ttys3 closed this Apr 17, 2021
@albertlauncher albertlauncher deleted a comment from githorse Apr 12, 2025
@ManuelSchneid3r
Copy link
Member

Why don't you just add a space to the trigger?

I have at least two websearches that do not use space. Do you think forcing people to use a space is better?

@ttys3
Copy link
Author

ttys3 commented Apr 13, 2025

Why don't you just add a space to the trigger?

I have at least two websearches that do not use space. Do you think forcing people to use a space is better?

the problem is not about the PR.

this PR is wrong.

because it try to fix a thing already broken by design.

the trigger should not need a space. this is the problem.

we want the trigger be trigger , not trigger(space).

just like the below example: the tirgger keyword is @gemini, not @gemini(space). people will type space themself.


Your own design is inhumane and does not conform to regular usage habits. Why not reflect on it yourself instead of asking others?

Since this is your own open-source project, I won't say much more.

You can refer to https://support.google.com/chrome/answer/14886647?hl=en

image

Note that if your design is only for your own use, feel free to do as you like.

If it's for public use, making something inhumane is not right. However, this is understandable since it's your personal project. You have the final say and can decide your preferences.

Please refrain from commenting any further.


keep it simple, keep it stupid.

@ManuelSchneid3r
Copy link
Member

The design is not broken.

The freedom to choose any trigger, even eg three spaces, is intended.

I just wanted to make sure that I did not fundamentally misunderstand something.

@ManuelSchneid3r
Copy link
Member

What do you suggest to chnage such that it becomes humane but does not force users to have to add a space for eg a "=2+2" query?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants